﻿using System;
using ControleRepresentante.Logic.Models;
using ControleRepresentante.Migration.Repositories;

namespace ControleRepresentante.Migration.Steps
{
    internal abstract class MigrationStepBase : IMigrationStep
    {
        protected static Guid CreateAttribute(Guid representanteId, string name, AttributeType type, ControleRepresentanteRepository controleRepresentanteRepository)
        {
            return controleRepresentanteRepository.CreateAttribute(representanteId, name, type);
        }

        public abstract void Migrate(Guid representanteId, MigrationStatus migrationStatus, ControleRepresentanteRepository controleRepresentanteRepository, ZTRepository ztRepository, Guid userId);

        protected static Guid GetClienteId(int id)
        {
            return new Guid(id, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }

        protected static Guid GetVendedorId(int id)
        {
            return new Guid(id, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }

        protected static Guid GetFabricaId(int id)
        {
            return new Guid(id, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }

        protected static Guid GetPedidoId(int id)
        {
            return new Guid(id, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }

        protected static Guid GetTransportadoraId(int id)
        {
            return new Guid(id, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }
    }
}